package com.example.eureka_consumer.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author samxie
 * @version 1.0
 * @date 2022-2-13 14:28
 */
@RestController
@Slf4j
public class DemoController {
	@Autowired
	RestTemplate restTemplate;

	@RequestMapping("/greet")
	public String sayHello(@RequestParam String name) {
		return restTemplate.getForObject("http://EUREKA-CLIENT/sayHello?param=" + name, String.class);
	}

}
